<extend name="Public/base"/>

<block name="body">
    <div class="main-title">
        <h2>添加会员</h2>
    </div>
    <hr>
    <form action="{:U()}" method="post" class="form-horizontal">
        <div class="form-item">
                    <label class="item-label">介绍人(手机号)</label>
                    <div class="controls">
                         <input type="text" class="text input-large" name="user_introducer" id="tel">
                         <button class="btn ajax-post" id="check">验证</button>
                    </div>
        </div>
        <div class="form-item">
                    <label class="item-label">介绍人(姓名不可编辑)</label>
                    <div class="controls">
                         <input type="text" class="text input-large" name="user_introducer_name" readOnly="true" id="jname">
                    </div>
        </div>
        <hr>
        <div class="form-item">
                    <label class="item-label">姓名</label>
                    <div class="controls">
                         <input type="text" class="text input-large" name="user_name">
                    </div>
        </div>
        <div class="form-item">
            <label class="item-label">加分倍数</label>
            <div class="controls">
                <select name="user_bei">
                    <option value="1" selected="">1</option>
                    <option value="2">2</option>
                    <option value="3">3</option>
                    <option value="4">4</option>
                    <option value="5">5</option>
                    <option value="6">6</option>
                    <option value="7">7</option>
                    <option value="8">8</option>
                    <option value="9">9</option>
                    <option value="10">10</option>
                    <option value="11">11</option>
                    <option value="12">12</option>
                    <option value="13">13</option>
                    <option value="14">14</option>
                    <option value="15">15</option>
                    <option value="16">16</option>
                    <option value="17">17</option>
                    <option value="18">18</option>
                    <option value="19">19</option>
                    <option value="20">20</option>
                    <option value="21">21</option>
                    <option value="22">22</option>
                    <option value="23">23</option>
                    <option value="24">24</option>
                    <option value="25">25</option>
                    <option value="26">26</option>
                    <option value="27">27</option>
                    <option value="28">28</option>
                    <option value="29">29</option>
                    <option value="30">30</option>
                    <option value="31">31</option>
                    <option value="32">32</option>
                    <option value="33">33</option>
                    <option value="34">34</option>
                    <option value="35">35</option>
                    <option value="36">36</option>
                    <option value="37">37</option>
                    <option value="38">38</option>
                    <option value="39">39</option>
                    <option value="40">40</option>
                    <option value="41">41</option>
                    <option value="42">42</option>
                    <option value="43">43</option>
                    <option value="44">44</option>
                    <option value="45">45</option>
                    <option value="46">46</option>
                    <option value="47">47</option>
                    <option value="48">48</option>
                    <option value="49">49</option>
                    <option value="50">50</option>
                    <option value="51">51</option>
                    <option value="52">52</option>
                    <option value="53">53</option>
                    <option value="54">54</option>
                    <option value="55">55</option>
                    <option value="56">56</option>
                    <option value="57">57</option>
                    <option value="58">58</option>
                    <option value="59">59</option>
                    <option value="60">60</option>
                </select>
            </div>
        </div>
        <div class="form-item">
                    <label class="item-label">身份证号</label>
                    <div class="controls">
                         <input type="text" class="text input-large" name="user_pernumber">
                    </div>
        </div>    
        <div class="form-item">
                    <label class="item-label">联系电话</label>
                    <div class="controls">
                         <input type="text" class="text input-large" name="user_tel">
                    </div>
        </div>     
        <div class="form-item">
                    <label class="item-label">银行卡号</label>
                    <div class="controls">
                         <input type="text" class="text input-large" name="user_bankcode">
                    </div>
        </div> 
        <div class="form-item">
                    <label class="item-label">年龄</label>
                    <div class="controls">
                         <input type="text" class="text input-large" name="user_age">
                    </div>
        </div>                   
        <div class="form-item">
                    <label class="item-label">从事行业</label>
                    <div class="controls">
                         <input type="text" class="text input-large" name="user_industry">
                    </div>
        </div>   
        <label class="item-label">性别</label>
        <div class="controls">
            <select name="user_sex">
                <option value="1" selected="">男</option>
                <option value="2">女</option>            
            </select>               
        </div>    
        <label class="item-label">家庭住址</label>
        {:hook('J_China_City')}
        <div class="form-item">
                    <label class="item-label">详细地址</label>
                    <div class="controls">
                         <input type="text" class="text input-large" name="user_add_4">
                    </div>
        </div>
        <input type="hidden" name="area" id="area"/>
        <div class="form-item">
                <label class="item-label">备注</label>
                <div class="controls">
                <label class="textarea input-large">
                    <textarea name="user_content"></textarea>
                </label>                
                </div>
        </div>         
        <div class="controls">
            <button class="btn submit-btn ajax-post" id="submit" type="submit" target-form="form-horizontal">确 定</button>          
                <button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
        </div>                                                
    </form>
</block>

<block name="script">
<script>
    $('#J_district').change(function(){
        var did_g=$(this).children('option:selected').attr('data');
        $('#area').val(did_g);
    });
    $('#check').click(function() {
        $.post("{:U('Member/member_check')}",{'tel':$('#tel').val()},function (data) {
            if (data.reg == 1) {
                $('#jname').val(data.data);
                return;
            } else {
                alert(data.info);
                return;
            };
        });
    });

</script>
</block>
